package org.wuyichun.announcement.service.impl;

import org.wuyichun.announcement.domain.Announcement;
import org.wuyichun.announcement.handler.MyHandler;
import org.wuyichun.announcement.service.IAnnouncementService;
import org.wuyichun.base.service.impl.BaseServiceImpl;
import org.springframework.stereotype.Service;

import java.io.IOException;

/**
 * 业务实现类：
 */
@Service
public class AnnouncementServiceImpl extends BaseServiceImpl<Announcement> implements IAnnouncementService {
    @Override
    public void insert(Announcement announcement) {
        // 审核
        super.insert(announcement);
        // 通知门户网站
        try {
            MyHandler.sendMessage(announcement.getTitle());
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
